<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!--CORE 标签库-->
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!--FMT 标签库-->
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    // 获得项目完全路径（假设你的项目叫ebuy_2023rj4，那么获得到的地址就是http://localhost:8081/ebuy_2023rj4/）:
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>网站后台管理系统HTML模板--模板之家 www.cssmoban.com</title>
    <link href="<%=basePath%>jsp/backstage/css/style.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="<%=basePath%>jsp/backstage/js/jquery.js"></script>

    <script type="text/javascript">
        function alertMessage(){//配合后端弹出返回的信息
            var message="${requestScope.myMessage}";
            if(message!=""){//如果后端返回了错误信息
                alert(message);
            }
        }

        $(document).ready(function () {
            alertMessage();

            //为删除链接绑定删除事件
            $("a[name='deleteAdmin']").click(function (){
                //如果true就直接跳转到链接对应的网址；如果是false则不跳转
                return window.confirm("确定要删除吗？删除后无法恢复")
            });


            $(".click").click(function () {
                $(".tip").fadeIn(200);
            });

            $(".tiptop a").click(function () {
                $(".tip").fadeOut(200);
            });

            $(".sure").click(function () {
                $(".tip").fadeOut(100);
            });

            $(".cancel").click(function () {
                $(".tip").fadeOut(100);
            });

        });
    </script>


</head>


<body>

<div class="place">
    <span>位置：</span>
    <ul class="placeul">
        <li><a href="#">首页</a></li>
        <li><a href="#">数据表</a></li>
        <li><a href="#">基本内容</a></li>
    </ul>
</div>

<div class="rightinfo">

    <div class="tools">

        <form action="<%=basePath%>backstage/adminmanage/list" method="get">
            <ul class="forminfo">
                <li  style="display: inline-block;"><label>账号名</label><input name="username" type="text" class="dfinput"/><i></i></li>
                <li  style="display: inline-block;"><label>姓名</label><input name="name" type="text" class="dfinput"/><i></i></li>
                <li  style="display: inline-block;"><input name="" type="submit" class="btn" value="查询"/></li>
                <li  style="display: inline-block;"><input name="" type="button" class="btn" value="重置" onclick="window.location='<%=basePath%>backstage/adminmanage/list'"/></li>
            </ul>
        </form>


        <ul class="toolbar">
            <a href="<%=basePath%>backstage/adminmanage/toAddAdmin">
            <li class="click"><span><img src="<%=basePath%>jsp/backstage/images/t01.png"/></span>添加管理员账号</li>
            </a>
<%--            <li><span><img src="<%=basePath%>jsp/backstage/images/t03.png"/></span>删除</li>--%>
<%--            <li><span><img src="<%=basePath%>jsp/backstage/images/t04.png"/></span>统计</li>--%>
        </ul>



<%--        <ul class="toolbar1">--%>
<%--            <li><span><img src="<%=basePath%>jsp/backstage/images/t05.png"/></span>设置</li>--%>
<%--        </ul>--%>

    </div>


    <table class="tablelist">
        <thead>
        <tr>
            <th><input name="" type="checkbox" value="" checked="checked"/></th>
            <th>账户名</th>
            <th>姓名</th>
            <th>性别</th>
            <th>锁定状态</th>
            <th>个人头像</th>
            <th>发布时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach var="admin" items="${requestScope.list}">
        <tr>
            <td><input name="" type="checkbox" value=""/></td>
            <td>${admin.username}</td>
            <td>${admin.name}</td>
            <td>
                <c:choose>
                    <c:when test="${admin.sex==1}">男</c:when>
                    <c:when test="${admin.sex==2}">女</c:when>
                    <c:otherwise>保密</c:otherwise>
                </c:choose>
            </td>
            <td>
                <c:choose>
                    <c:when test="${admin.unLocked}"><span style="color: green;">不锁定</span></c:when>
                    <c:otherwise><span style="color: red;">锁定</span></c:otherwise>
                </c:choose>
            </td>
            <td>${admin.photo}</td>
            <td>
                <fmt:formatDate value="${admin.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>

            </td>
            <td><a href="<%=basePath%>backstage/adminmanage/toUpdateAdmin?id=${admin.id}" class="tablelink">修改</a>
                <a name="deleteAdmin" href="<%=basePath%>backstage/adminmanage/deleteAdmin?id=${admin.id}" class="tablelink"> 删除</a>
            </td>
        </tr>
        </c:forEach>
        </tbody>
    </table>


    <div class="pagin">
        <div class="message">共<i class="blue">1256</i>条记录，当前显示第&nbsp;<i class="blue">2&nbsp;</i>页</div>
        <ul class="paginList">
            <li class="paginItem"><a href="javascript:;"><span class="pagepre"></span></a></li>
            <li class="paginItem"><a href="javascript:;">1</a></li>
            <li class="paginItem current"><a href="javascript:;">2</a></li>
            <li class="paginItem"><a href="javascript:;">3</a></li>
            <li class="paginItem"><a href="javascript:;">4</a></li>
            <li class="paginItem"><a href="javascript:;">5</a></li>
            <li class="paginItem more"><a href="javascript:;">...</a></li>
            <li class="paginItem"><a href="javascript:;">10</a></li>
            <li class="paginItem"><a href="javascript:;"><span class="pagenxt"></span></a></li>
        </ul>
    </div>


</div>

<script type="text/javascript">
    $('.tablelist tbody tr:odd').addClass('odd');
</script>
</body>
</html>
